package com.example.h9iserver.controller;

import com.example.h9iserver.common.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author 4040
 * @Date 2025/7/29 9:43
 */

@RestController
@RequestMapping("test")
public class Test {

    @Autowired
    private PasswordEncoder passwordEncoder;

    @GetMapping("/debug/encoder")
    public String debugEncoder() {
        return "当前使用的 PasswordEncoder：" + passwordEncoder.getClass().getName();
        // 应输出：org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
    }
    @GetMapping
    public Result<String> test() {
        return Result.success("hello world");
    }
}
